package vnu;

import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import vocabulary.MyDatabaseVoca;

public class DBAdapter implements MyDatabaseVoca {
	
	private static java.sql.Connection conn;
	private static Statement statement;
	public DBAdapter(){
		// initial Data base in here
		String connection = URL+MYSQL_DB+CHARSET;
	
			try {
				Class.forName("com.mysql.jdbc.Driver").newInstance();
				try {
					conn = DriverManager.getConnection(connection, MYSQL_USER, MYSQL_PASSWORD);
					System.out.println("Open connect to database!");
					statement=conn.createStatement();
				//	createTable();
					
					
					
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			} catch (InstantiationException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (ClassNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			
	}	
	
		
	}
	
	
		
	
	
	